package com.example.foodtruckdemo.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.foodtruckdemo.controller.vo.GeoHashVo;
import com.example.foodtruckdemo.controller.vo.MobileFoodFacilityPermitPageByPositionReq;
import com.example.foodtruckdemo.controller.vo.MobileFoodFacilityPermitPageReq;
import com.example.foodtruckdemo.controller.vo.MobileFoodFacilityPermitPageVo;
import com.example.foodtruckdemo.domain.MobileFoodFacilityPermit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author jin
* @description 针对表【Mobile_Food_Facility_Permit_csv】的数据库操作Mapper
* @createDate 2024-09-03 12:25:30
* @Entity generator.domain.MobileFoodFacilityPermit
*/
public interface MobileFoodFacilityPermitMapper extends BaseMapper<MobileFoodFacilityPermit> {

    Page<MobileFoodFacilityPermitPageVo> page(Page page, @Param("req") MobileFoodFacilityPermitPageReq req);

    /**
     * 查询geohash值为空的记录
     * @param page
     * @return
     */
    Page<GeoHashVo> getBlankGeohash(Page page);

    /**
     * 更新geohash值
     * @param records
     */
    void updateGeoHash(@Param("list") List<GeoHashVo> records);

    /**
     * 统计位置附近胡餐车
     *
     * @param req
     * @param geoHashCodePrefixs
     * @return
     */
    int countByPosition(@Param("req") MobileFoodFacilityPermitPageByPositionReq req, @Param("geoHashCodePrefixs") List<String> geoHashCodePrefixs);

    /**
     * 查找位置附近胡餐车
     *
     * @param req
     * @param geoHashCodePrefixs
     * @return
     */
    List<MobileFoodFacilityPermitPageVo> getByPosition(@Param("req") MobileFoodFacilityPermitPageByPositionReq req, @Param("geoHashCodePrefixs") List<String> geoHashCodePrefixs);

}




